package com.un.ebs.sys.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.un.ebs.core.enums.PowerTypeEnum;
import com.un.ebs.sys.domain.AppPower;
import com.un.ebs.sys.domain.UserExt;
import com.un.ebs.sys.dto.AppPowerAddDto;
import com.un.ebs.sys.dto.AppPowerUpdateDto;
import com.un.ebs.sys.dto.ObjectParentAndIndexChangeDto;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author liubo
 * @since 2019-09-18
 */
public interface AppPowerService extends IService<AppPower> {

    void add(AppPowerAddDto req);

    void update(AppPowerUpdateDto req);

    AppPower queryById(String id);

    void changeParent(String id, String parentId);

    void changeParentOrIndexBatch(List<ObjectParentAndIndexChangeDto> list);

    List<AppPower> queryByParentId(String parentId);

    IPage<AppPower> queryPageByParentId(String parentId, int pageSize, int pageIndex);

    void delete(String id);

    void changeSort(String id, int index);

    boolean checkPower(String id);

    boolean checkResourcePower(String roleId, String resourceId, PowerTypeEnum type);

    List<String> queryResourcePower(List<String> roleIds, PowerTypeEnum type);

    List<String> queryResourcePower(String roleId, PowerTypeEnum type);

    List<String> queryResourcePower(PowerTypeEnum type);

    List<UserExt> queryUserByResourcePower(String resourceId, PowerTypeEnum type);

}
